home *** CD-ROM | disk | FTP | other *** search
- function initTarget()
- {
- target_mc = totaltarget_mc.target_mc;
- target_mc.gor = 0;
- now_target = 1;
- var _loc2_ = 1;
- while(_loc2_ <= 8)
- {
- if(_loc2_ == 1 or _loc2_ == 5)
- {
- this.target_mc["target" + _loc2_ + "_mc"].objType = 1;
- }
- if(_loc2_ == 2 or _loc2_ == 6)
- {
- this.target_mc["target" + _loc2_ + "_mc"].objType = 3;
- }
- if(_loc2_ == 3 or _loc2_ == 7)
- {
- this.target_mc["target" + _loc2_ + "_mc"].objType = 2;
- }
- if(_loc2_ == 4 or _loc2_ == 8)
- {
- this.target_mc["target" + _loc2_ + "_mc"].objType = 4;
- }
- if(_loc2_ == 1)
- {
- this.target_mc["target" + _loc2_ + "_mc"].gotoAndStop(1);
- }
- else
- {
- this.target_mc["target" + _loc2_ + "_mc"].gotoAndStop(4);
- }
- _loc2_ = _loc2_ + 1;
- }
- }
- function initObj()
- {
- var _loc2_ = 1;
- while(_loc2_ <= 5)
- {
- if(this["obj" + _loc2_ + "_mc"].objNum == undefined)
- {
- this["obj" + _loc2_ + "_mc"].objNum = _loc2_;
- }
- if(_loc2_ != 1)
- {
- this["obj" + _loc2_ + "_mc"]._x = obj1_mc._x - (_loc2_ - 1) * obj_space;
- }
- gof = Math.floor(Math.random() * 4) + 1;
- this["obj" + _loc2_ + "_mc"].gotoAndStop(gof);
- if(this["backY" + _loc2_] == undefined)
- {
- this["backY" + _loc2_] = this["obj" + _loc2_ + "_mc"]._y;
- }
- _loc2_ = _loc2_ + 1;
- }
- _loc2_ = 1;
- while(_loc2_ <= 5)
- {
- idx = Math.floor(Math.random() * 5) + 1;
- this["obj" + _loc2_ + "_mc"]._y = this["backY" + idx];
- _loc2_ = _loc2_ + 1;
- }
- }
- function clickStartBtn()
- {
- msg_mc.gotoAndStop(1);
- game_start = true;
- }
- function depthUp()
- {
- brdNnum_mc.nextFrame();
- i = 1;
- while(i <= 8)
- {
- if(target_mc["target" + now_target + "_mc"].getDepth() < target_mc["target" + i + "_mc"].getDepth())
- {
- target_mc["target" + now_target + "_mc"].swapDepths(target_mc["target" + i + "_mc"]);
- }
- i++;
- }
- if(brdNnum_mc._currentframe == brdTnum_mc._currentframe)
- {
- game_start = false;
- m_level++;
- sound_mc.gotoAndPlay("CLEAR");
- level_init();
- }
- }
- function level_init()
- {
- if(m_level < 6)
- {
- levelNum_mc.gotoAndStop(m_level);
- msg_mc.gotoAndStop(m_level + 1);
- brdNnum_mc.gotoAndStop(1);
- gof = dfObj + (m_level - 1) * plusObj + 1;
- brdTnum_mc.gotoAndStop(gof);
- obj_space -= 11;
- obj_speed += 0.8;
- obj1_mc._x = -86;
- Ntime = 0;
- initObj();
- }
- else
- {
- stopAllSounds();
- msg_mc.gotoAndStop(7);
- }
- }
- function corn_plus()
- {
- loadVariables("http://www.ibravo.com/Web/Game/Popup/UpdatePoint.aspx?corn=10",this,"POST");
- }
- stop();
- var keybuf = 0;
- var rt_speed = 5;
- var obj_speed = 3;
- var obj_space = 400;
- var plusObj = 5;
- var dfObj = 10;
- var obj_endX = 400;
- var m_level = 1;
- var game_start = false;
- var dontMove = false;
- var fps = 30;
- var Ttime = 100;
- var Ntime = 0;
- var mnTime = 120;
- initTarget();
- initObj();
- level_init();
- this.onEnterFrame = function()
- {
- if(game_start == true)
- {
- if(dontMove == false)
- {
- Ntime++;
- temp = Ntime / fps;
- if(temp == 0)
- {
- temp = 1;
- }
- gof = Math.round(temp * time_mc._totalframes / Ttime);
- time_mc.gotoAndStop(gof);
- if(Ntime / fps >= Ttime and msg_mc._currentframe != 8)
- {
- game_start = false;
- stopAllSounds();
- msg_mc.gotoAndStop(8);
- }
- }
- if(Key.isDown(37) and dontMove == false)
- {
- if(keybuf == 0 and target_mc.gor == 0)
- {
- keybuf = 10;
- target_mc.gor = -45;
- target_mc["target" + now_target + "_mc"].gotoAndStop(4);
- if(now_target == 8)
- {
- now_target = 1;
- }
- else
- {
- now_target++;
- }
- target_mc["target" + now_target + "_mc"].gotoAndStop(1);
- sound_mc.gotoAndPlay("ROTATE");
- }
- }
- else if(Key.isDown(39) and dontMove == false)
- {
- if(keybuf == 0 and target_mc.gor == 0)
- {
- keybuf = 10;
- target_mc.gor = 45;
- target_mc["target" + now_target + "_mc"].gotoAndStop(4);
- if(now_target == 1)
- {
- now_target = 8;
- }
- else
- {
- now_target--;
- }
- target_mc["target" + now_target + "_mc"].gotoAndStop(1);
- sound_mc.gotoAndPlay("ROTATE");
- }
- }
- else if(Key.isDown(40))
- {
- if(keybuf == 0 and target_mc.gor == 0)
- {
- keybuf = 10;
- var _loc2_ = 1;
- while(_loc2_ <= 5)
- {
- var _loc3_ = this["obj" + _loc2_ + "_mc"]._currentframe;
- if(Math.abs(this["obj" + _loc2_ + "_mc"]._y - backY1) < 2 and _loc3_ <= 4)
- {
- this["obj" + _loc2_ + "_mc"]._y = backY2;
- }
- else if(Math.abs(this["obj" + _loc2_ + "_mc"]._y - backY2) < 2 and _loc3_ <= 4)
- {
- this["obj" + _loc2_ + "_mc"]._y = backY3;
- }
- else if(Math.abs(this["obj" + _loc2_ + "_mc"]._y - backY3) < 2 and _loc3_ <= 4)
- {
- this["obj" + _loc2_ + "_mc"]._y = backY4;
- }
- else if(Math.abs(this["obj" + _loc2_ + "_mc"]._y - backY4) < 2 and _loc3_ <= 4)
- {
- this["obj" + _loc2_ + "_mc"]._y = backY5;
- }
- else if(Math.abs(this["obj" + _loc2_ + "_mc"]._y - backY5) < 2 and _loc3_ <= 4)
- {
- this["obj" + _loc2_ + "_mc"]._y = backY1;
- }
- sound_mc.gotoAndPlay("MOVE");
- _loc2_ = _loc2_ + 1;
- }
- }
- }
- else if(Key.isDown(38))
- {
- if(keybuf == 0 and target_mc.gor == 0)
- {
- keybuf = 10;
- _loc2_ = 1;
- while(_loc2_ <= 5)
- {
- _loc3_ = this["obj" + _loc2_ + "_mc"]._currentframe;
- if(Math.abs(this["obj" + _loc2_ + "_mc"]._y - backY1) < 2 and _loc3_ <= 4)
- {
- this["obj" + _loc2_ + "_mc"]._y = backY5;
- }
- else if(Math.abs(this["obj" + _loc2_ + "_mc"]._y - backY2) < 2 and _loc3_ <= 4)
- {
- this["obj" + _loc2_ + "_mc"]._y = backY1;
- }
- else if(Math.abs(this["obj" + _loc2_ + "_mc"]._y - backY3) < 2 and _loc3_ <= 4)
- {
- this["obj" + _loc2_ + "_mc"]._y = backY2;
- }
- else if(Math.abs(this["obj" + _loc2_ + "_mc"]._y - backY4) < 2 and _loc3_ <= 4)
- {
- this["obj" + _loc2_ + "_mc"]._y = backY3;
- }
- else if(Math.abs(this["obj" + _loc2_ + "_mc"]._y - backY5) < 2 and _loc3_ <= 4)
- {
- this["obj" + _loc2_ + "_mc"]._y = backY4;
- }
- sound_mc.gotoAndPlay("MOVE");
- _loc2_ = _loc2_ + 1;
- }
- }
- }
- else
- {
- keybuf = 0;
- }
- }
- if(target_mc.gor > 0)
- {
- target_mc.gor -= rt_speed;
- target_mc._rotation += rt_speed;
- }
- if(target_mc.gor < 0)
- {
- target_mc.gor += rt_speed;
- target_mc._rotation -= rt_speed;
- }
- };
-